package com.baofu.paycore.common.utils;

import com.google.common.collect.Lists;

import java.util.LinkedList;

/**
 * ListBuilder
 *
 *
 * @author LZQ
 * @param <T>
 */
public class ListBuilder<T> {

    private LinkedList<T> list;

    private ListBuilder(){
        list = Lists.newLinkedList();
    }

    public static <T> ListBuilder<T> of(){
        return new ListBuilder<T>();
    }

    public ListBuilder<T> add(T bean){
        list.add(bean);
        return this;
    }

    public LinkedList<T> list(){
        return list;
    }
}
